//
//  HYBottomView.m
//  _normal
//
//  Created by Ezra on 16/6/9.
//  Copyright © 2016年 Ezra. All rights reserved.
//

#import "HYBottomView.h"
#import "HYThemeItem.h"

@interface HYBottomView()


@property (weak, nonatomic) IBOutlet UIButton *shareBtn;

@property (weak, nonatomic) IBOutlet UIButton *clickBtn;



@property (weak, nonatomic) IBOutlet UILabel *dateLabel;


@end

@implementation HYBottomView

-(void)setItem:(HYThemeItem *)item
{
    [super setItem:item];
    
    [self setButton:self.clickBtn count:item.click title:nil];
    [self setButton:self.shareBtn count:item.share title:nil];
    
}






- (void)setButton:(UIButton *)button count:(NSInteger)count title:(NSString *)title
{
    NSString *str = title;
    if (count > 10000) {
        CGFloat dingF = count / 10000.0;
        
        str = [NSString stringWithFormat:@"%.1f万",dingF];
        str = [str stringByReplacingOccurrencesOfString:@".0" withString:@""];
    }else if(count > 0){
        str = [NSString stringWithFormat:@"%ld",count];
    }
    [button setTitle:str forState:UIControlStateNormal];
}

@end
